﻿using System;
using System.Windows.Forms;

namespace idataplatform
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void 商场基础数据ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            baseinfo2 form2 = new baseinfo2();
            form2.ShowDialog();
        }

        private void 用户管理ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            usermanager form2 = new usermanager();
            form2.ShowDialog();
        }

        private void 商场客流数据ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //ckinfo form2 = new ckinfo();
            //form2.ShowDialog();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            conncls conns = new conncls();
            string ckdateSQL = "SELECT DATE_FORMAT(MAX(ckdate),'%Y年%c月%d日') FROM ckdata_ipark;";
            label2.Text = conns.varStr(ckdateSQL);
            string chgdateSQL = "SELECT DATE_FORMAT(MAX(jftime),'%Y年%c月%d日') FROM jfchange_ipark;";
            label3.Text = conns.varStr(chgdateSQL);
            string hxdateSQL = "SELECT DATE_FORMAT(MAX(HXTIME),'%Y年%c月%d日') FROM qhxtab_ipark;";
            label5.Text = conns.varStr(hxdateSQL);
        }

        private void 商场客流数据ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ckinfo form2 = new ckinfo();
            form2.ShowDialog();
        }

        private void 会员数据上传ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            loadhydata form2 = new loadhydata();
            form2.ShowDialog();
            if (pubcls.upmark1 == true)
            {
                conncls conns = new conncls();
                string chgdateSQL = "SELECT DATE_FORMAT(MAX(jftime),'%Y年%c月%d日') FROM jfchange_ipark;";
                label3.Text = conns.varStr(chgdateSQL);
                string hxdateSQL = "SELECT DATE_FORMAT(MAX(HXTIME),'%Y年%c月%d日') FROM qhxtab_ipark;";
                label5.Text = conns.varStr(hxdateSQL);
            }
        }
    }
}
